#ifndef AUDIO_H
#define AUDIO_H

#include "cMusic.h"
#include <fmod_errors.h>
#include <Windows.h>

class cAudio
{
	public:
		//Initialize the data members of the class
		cAudio();

		//Dynamically deletes any dynamic objects
		~cAudio();

		//Checks the FMOD system for errors
		void FMODErrorCheck(FMOD_RESULT result);

		//Provides playback
		void play(FMOD::Sound *sound);

		void stop(FMOD::Sound *sound);

		//Provides a pause to the playback
		void pause(FMOD::Sound *sound);

		bool isLooping();

		void changeLoop(bool bIsLooping);

		//Makes the sound file and returns it to a Sound object
		cSound* makeSound(char *fileName);

		//Makes the music file and returns it to a Music object
		cMusic* makeMusic(char *fileName);

	private:
		//System for creating different object with the FMOD system
		FMOD::System		*m_pSystem;							//System Interface for FMOD: the central control structure
		FMOD_RESULT			m_result;							//Holds the results of a test case in FMOD
		unsigned int		m_version;							//Provides the current version of FMOD
		int					m_numDrivers;						//Stores the number of drivers for FMOD
		FMOD_SPEAKERMODE	m_speakerMode;						//Convert between the different modes of the hardware
		FMOD_CAPS			m_caps;								//Provides the capabilities of the different devices
		char				m_name[256];						
		
		//Information pertaining to playback functionality
		bool				m_bIsPlaying;
		bool				m_bIsLooping;
		FMOD::Channel		*m_pChannel;
		FMOD::ChannelGroup	*m_pChannelGroup;
};

#endif